﻿function UtilFunctions()
{
}

UtilFunctions.prototype.ReplaceHtmlContent = function(elementID, newContent)
{
    var someElement = document.getElementById(elementID); 
    
    if (someElement.outerHTML)
    {
        someElement.outerHTML = newContent;
    }
    else
    {
        var range = document.createRange();
        range.setStartBefore(someElement);
        var docFrag = range.createContextualFragment(newContent);
        someElement.parentNode.replaceChild(docFrag, someElement);
    }
}